package com.aikon.wht.java8;

import com.google.common.collect.Maps;

import java.util.Map;

public final class TestOfZookeeper {

	public TestOfZookeeper(int code) {
		this.code = code;
	}

	public static void main(String[] args){
		char cs[] = {'a','b','c','d','e','f','g','h','u','v'};
		char lastc = 'x';
		for(int i=0;i<cs.length;i++){
			System.out.println(lastc);
			lastc=cs[i];
		}
		Map<String,Integer> map = Maps.newConcurrentMap();
		map.put("s", 1);
		System.out.println(map.put("s", 2));
//		map.put("s",3);
		System.out.println(map.get("s"));
		System.out.println(hash("sdfasdf"));
		System.out.println("*********************************");
		System.out.println(hash(new TestOfZookeeper(123).code));
		System.out.println(hash(new TestOfZookeeper(123).code));
		new String();
		int s,i,j,t;
		System.out.println(i=(s=(j=(t=44))));
		System.out.println(s);
		Class<?> c = map.getClass();
		System.out.println(c.getInterfaces().length);
	}

	static final int hash(Object key) {
		int h;
		return (key == null) ? 0 : (h = key.hashCode()) ^ (h >>> 16);
	}

	int code;

	@Override
	public boolean equals(Object o) {
		if (this == o) return true;
		if (o == null || getClass() != o.getClass()) return false;

		TestOfZookeeper that = (TestOfZookeeper) o;

		return code == that.code;

	}

//	@Override
//	public int hashCode() {
//		return code;
//	}


	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}
}
